// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 设备联动动作配置列表 GET /api/device/linkage/command */
export async function queryDeviceLinkageCommand(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/device/linkage/command', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新设备联动任务 PUT /api/device/linkage/command */
export async function updateDeviceLinkageCommand(
  body: API.DeviceLinkageCommandItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/device/linkage/command', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加设备联动任务 POST /api/device/linkage/command */
export async function addDeviceLinkageCommand(
  body: API.DeviceLinkageCommandItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/device/linkage/command', {
    method: 'POST',
    requestType:'form',
    data: body,
    ...(options || {}),
  });
}

/** 删除设备联动任务 DELETE /api/device/linkage/command */
export async function removeDeviceLinkageCommand(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/linkage/command', {
    method: 'DELETE',
    params: options,
  });
}
